package behavior.interpreter;

import java.util.HashMap;

//变量解释器
public class VarExpression implements Expression {
    private String key;

    public VarExpression(String key) {
        this.key = key;
    }

    @Override
    //根据变量名称返回对应的值
    public int interpreter(HashMap<String, Integer> map) {
        return map.get(key);
    }
}
